<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-siteapp" />
         <link href="/TP/Public/assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="/TP/Public/css/style.css"/>       
        <link href="/TP/Public/assets/css/codemirror.css" rel="stylesheet">
        <link rel="stylesheet" href="/TP/Public/assets/css/ace.min.css" />
        <link rel="stylesheet" href="/TP/Public/font/css/font-awesome.min.css" />
        <!--[if lte IE 8]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->
		<script src="/TP/Public/js/jquery-2.1.3.min.js"></script>
        <script src="/TP/Public/assets/js/bootstrap.min.js"></script>
       <!--  <script type="text/javascript" src="/TP/Public/Widget/Validform/5.3.2/Validform.min.js"></script>
		<script src="/TP/Public/assets/js/typeahead-bs2.min.js"></script>           	
		<script src="/TP/Public/assets/js/jquery.dataTables.min.js"></script>
		<script src="/TP/Public/assets/js/jquery.dataTables.bootstrap.js"></script>
        <script src="/TP/Public/assets/layer/layer.js" type="text/javascript" ></script>          
		<script src="/TP/Public/js/lrtk.js" type="text/javascript" ></script>
         <script src="/TP/Public/assets/layer/layer.js" type="text/javascript"></script>	
        <script src="/TP/Public/assets/laydate/laydate.js" type="text/javascript"></script> -->
<title>广告管理</title>
</head>

<body>
<div class="page-content clearfix">
  <div class="administrator">
   <!-- 搜索栏？ -->
     <!--   <form class="form-inline">
        <div class="form-group">
          <input type="text" class="form-control" id="exampleInputName2" placeholder="请输入用户名">
        </div>
        <button type="submit" class="btn btn-default">搜索</button>
      </form> -->
      <div class="table_menu_list"  id="testIframe">
   <table class="table table-striped table-bordered table-hover" id="sample_table">
		<thead>
		 <tr>
				<!-- <th width="25px"><label><input type="checkbox" class="ace"><span class="lbl"></span></label></th> -->
				<th width="80px">编号</th>
				<th width="150px">广告名</th>
				<th width="100px">广告图片</th>
				<th width="220px">广告链接</th>
        <!-- <th width="100px">角色</th>				 -->
				<th width="130px">加入时间</th>
				<th width="100px">是否显示</th>                
				<th width="200px">操作</th>
			</tr>
		</thead>
	<tbody>
  <!-- //遍历开始 -->
  <?php if(is_array($list)): foreach($list as $key=>$list): ?><tr id="advs_<?php echo ($list["id"]); ?>">
      <!-- <td><label><input type="checkbox" class="ace"><span class="lbl"></span></label></td> -->
      <td><?php echo ($list["id"]); ?></td>
      <td><?php echo ($list["advsname"]); ?></td>
      <td><img src="/TP/Uploads/<?php echo ($list["picname"]); ?>" alt="这是一张图片" width="95px" height="100px" /></td>
      <td><?php echo ($list["advslink"]); ?></td>
      <td><?php echo ($list["addtime"]); ?></td>
      <td class="td-status"><span class="label label-success radius" ><?php echo ($list["status"]); ?></span></td>
      <td class="td-manage">
        <a href="<?php echo U('Admin/advs/edit_advs',['id'=>$list['id']]);?>" class="btn btn-xs btn-success">修改</a>
        <a href="javascript:;" class="btn btn-xs btn-warning" onclick="del(<?php echo ($list["id"]); ?>)">删除</a>
       </td>
     </tr><?php endforeach; endif; ?>
      <!-- 遍历结束 -->
    </table>
        <!-- <div id="btnBox" align="right"><?php echo ($show); ?></div> -->
      </div>
     </div>
  </div>
</div>

</body>
</html>
<script type="text/javascript">
   //删除操作
   function del(id){
    if(confirm('是否删除') == true){
      $.get("<?php echo U('Admin/advs/advs_del');?>",{'id':id},function(data){
        if(data == '删除成功'){
          var del = "#advs_"+id;
          // alert(del);
          $(del).remove();
        }else{data}
      })
    }
   }
</script>